package me.firstapp.module.weixin.member;

import java.util.Date;
import java.util.HashMap;
import java.util.Map;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Table;

import me.firstapp.module.base.BaseEntity;

/**
 * 用户模型
 * 
 * @Created by keanu.
 * @Copyright (c) 2016, All Rights Reserved.
 * @website http://firstapp.me
 */
@Entity
@Table(name = "MEMBER_MEMBER")
public class Member extends BaseEntity {
	private static final long serialVersionUID = 7975950237828106264L;

	public static final int STATUS_USE = 1;// 启用状态
	public static final int STATUS_NO_USE = 0;// 禁用状态
	public static final int FOLLOW_STATUS_YES = 1;// 已关注
	public static final int FOLLOW_STATUS_NO = 0;// 未关注
	public static final int VIP_LEVEL_FANS = 0;// 粉丝
	public static final int VIP_LEVEL_BASE = 1;// 会员
	public static final int VIP_LEVEL_HIGHT = 2;// 代理
	public static final Map<Integer, String> levelMap = new HashMap<Integer, String>();
	static {
		levelMap.put(VIP_LEVEL_FANS, "粉丝");
		levelMap.put(VIP_LEVEL_BASE, "会员");
		levelMap.put(VIP_LEVEL_HIGHT, "代理");
	}

	// 用户名
	@Column(name = "NAME", length = 40)
	private String name;

	// 头像地址
	@Column(name = "AVATAR", length = 200)
	private String avatar;

	// 手机号
	@Column(name = "MOBILE", length = 11)
	private String mobile;

	// 微信号
	@Column(name = "WEIXIN", length = 20)
	private String weixin;

	// 关注状态，0：取消关注，1：已关注
	@Column(name = "FOLLOW_STATUS", columnDefinition = "TINYINT", nullable = false)
	private Integer followStatus;

	// 微信openId
	@Column(name = "OPEN_ID", length = 40, unique = true, nullable = false)
	private String openId;

	// 卡号
	@Column(name = "CARD_NO", length = 40, unique = true, nullable = false)
	private String cardNo;

	// 上级的微信openId
	@Column(name = "CHIEF_OPEN_ID", length = 40, nullable = false)
	private String chiefOpenId;

	// 上级卡号
	@Column(name = "CHIEF_CARD_NO", length = 40, nullable = false)
	private String chiefCardNo;

	// 流水号
	@Column(name = "FLOW", nullable = false)
	private Long flow;

	// 0粉丝，1基础会员，2高级代理，3合伙人
	@Column(name = "VIP_LEVEL", columnDefinition = "TINYINT DEFAULT 0 ", nullable = false)
	private Integer vipLevel;

	// 等级到期日，如果永久，则是2117-09-09 23:59:59
	@Column(name = "EXPIRE_DATE", columnDefinition = "DATETIME", nullable = false)
	private Date expireDate;

	// 注册时间
	@Column(name = "REGISTER_TIME", columnDefinition = "DATETIME", nullable = false)
	private Date registerTime;

	// 状态，0：禁用，1：启用
	@Column(name = "STATUS", columnDefinition = "TINYINT", nullable = false)
	private Integer status = 1;

	// 粉丝数
	@Column(name = "FANS_COUNTS", nullable = false)
	private Long fansCounts;

	// 所属合伙人openId
	@Column(name = "PARTNER_OPEN_ID", length = 40)
	private String partnerOpenId;

	// 所属合伙人卡号
	@Column(name = "PARTNER_CARD_NO", length = 40)
	private String partnerCardNo;

	// 默认收货人姓名
	@Column(name = "RECEIVE_NAME", length = 20)
	private String receiveName;

	// 默认收货人手机号
	@Column(name = "RECEIVE_MOBILE", length = 11)
	private String receiveMobile;

	// 默认收货人地址
	@Column(name = "RECEIVE_ADDRESS", length = 300)
	private String receiveAddress;

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getAvatar() {
		return avatar;
	}

	public void setAvatar(String avatar) {
		this.avatar = avatar;
	}

	public String getMobile() {
		return mobile;
	}

	public void setMobile(String mobile) {
		this.mobile = mobile;
	}

	public Date getRegisterTime() {
		return registerTime;
	}

	public void setRegisterTime(Date registerTime) {
		this.registerTime = registerTime;
	}

	public Integer getStatus() {
		return status;
	}

	public void setStatus(Integer status) {
		this.status = status;
	}

	public String getOpenId() {
		return openId;
	}

	public void setOpenId(String openId) {
		this.openId = openId;
	}

	public String getChiefOpenId() {
		return chiefOpenId;
	}

	public void setChiefOpenId(String chiefOpenId) {
		this.chiefOpenId = chiefOpenId;
	}

	public String getCardNo() {
		return cardNo;
	}

	public void setCardNo(String cardNo) {
		this.cardNo = cardNo;
	}

	public String getWeixin() {
		return weixin;
	}

	public void setWeixin(String weixin) {
		this.weixin = weixin;
	}

	public Integer getFollowStatus() {
		return followStatus;
	}

	public void setFollowStatus(Integer followStatus) {
		this.followStatus = followStatus;
	}

	public Long getFlow() {
		return flow;
	}

	public void setFlow(Long flow) {
		this.flow = flow;
	}

	public String getChiefCardNo() {
		return chiefCardNo;
	}

	public void setChiefCardNo(String chiefCardNo) {
		this.chiefCardNo = chiefCardNo;
	}

	public Integer getVipLevel() {
		return vipLevel;
	}

	public void setVipLevel(Integer vipLevel) {
		this.vipLevel = vipLevel;
	}

	public Long getFansCounts() {
		return fansCounts;
	}

	public void setFansCounts(Long fansCounts) {
		this.fansCounts = fansCounts;
	}

	public String getPartnerOpenId() {
		return partnerOpenId;
	}

	public void setPartnerOpenId(String partnerOpenId) {
		this.partnerOpenId = partnerOpenId;
	}

	public String getPartnerCardNo() {
		return partnerCardNo;
	}

	public void setPartnerCardNo(String partnerCardNo) {
		this.partnerCardNo = partnerCardNo;
	}

	public Date getExpireDate() {
		return expireDate;
	}

	public void setExpireDate(Date expireDate) {
		this.expireDate = expireDate;
	}

	public String getReceiveName() {
		return receiveName;
	}

	public void setReceiveName(String receiveName) {
		this.receiveName = receiveName;
	}

	public String getReceiveMobile() {
		return receiveMobile;
	}

	public void setReceiveMobile(String receiveMobile) {
		this.receiveMobile = receiveMobile;
	}

	public String getReceiveAddress() {
		return receiveAddress;
	}

	public void setReceiveAddress(String receiveAddress) {
		this.receiveAddress = receiveAddress;
	}
}
